package com.imarec.web.persistence;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class EntityManagerHolder
{
	private static EntityManagerFactory entityManagerFactory;
	
	public static EntityManager getEntityManager()
	{
		if(entityManagerFactory == null) entityManagerFactory = Persistence.createEntityManagerFactory("imarec");
		return entityManagerFactory.createEntityManager();
	}
}
